﻿using System;
namespace Xtee.XteeClient.Karis {
    using Producers.Karis.Xtee.Riik.Ee.Producer.Karis;
    using Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages;
    using global::Xtee.Core;
    using System.Collections.Generic;
    
    
    public class KarisAdapter {
        
        private string _producer = "karis";
        
        private string _toimik;
        
        private string _allAsutus;
        
        private string _amet;
        
        private string _ametnikNimi;
        
        private string _autentija;
        
        private string _ametnik;
        
        private Xtee.Core.Client.IXteeCommand _xteeCommand;
        
        public KarisAdapter() : 
                this(new Xtee.Core.Client.XteeCommand(new Xtee.Core.Client.Config.Configuration())) {
        }
        
        public KarisAdapter(Xtee.Core.Client.IXteeCommand command) {
            this._xteeCommand = command;
            if (!string.IsNullOrEmpty(_xteeCommand.Configuration.AlternateProducer)) {
                this._producer = _xteeCommand.Configuration.AlternateProducer;
            }
        }
        
        public virtual string Producer {
            get {
                return this._producer;
            }
            set {
                this._producer = value;
            }
        }
        
        public virtual string Toimik {
            get {
                return this._toimik;
            }
            set {
                this._toimik = value;
            }
        }
        
        public virtual string AllAsutus {
            get {
                return this._allAsutus;
            }
            set {
                this._allAsutus = value;
            }
        }
        
        public virtual string Amet {
            get {
                return this._amet;
            }
            set {
                this._amet = value;
            }
        }
        
        public virtual string AmetnikNimi {
            get {
                return this._ametnikNimi;
            }
            set {
                this._ametnikNimi = value;
            }
        }
        
        public virtual string Autentija {
            get {
                return this._autentija;
            }
            set {
                this._autentija = value;
            }
        }
        
        public virtual string Ametnik {
            get {
                return this._ametnik;
            }
            set {
                this._ametnik = value;
            }
        }
        
        public virtual Xtee.Core.Client.IXteeCommand XteeCommand {
            get {
                return this._xteeCommand;
            }
            set {
                this._xteeCommand = value;
            }
        }
        
        public virtual string KonstrueeriTeenuseNimi(string teenuseNimi, string versioon) {
            return string.Format("{0}.{1}.{2}", this.Producer, teenuseNimi,versioon);
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKvkIsikudVastus KvkIsikud(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKvkIsikudParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "kvk_isikud", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("kvk_isikud", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KvkIsikud(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKvkIsikudResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrIsikVastus KrIsik(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrIsikParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krIsik", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krIsik", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrIsik(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrIsikResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrIsikudVastus KrIsikud(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrIsikudParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krIsikud", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krIsikud", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrIsikud(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrIsikudResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrIsikIdVastus KrIsikId(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrIsikIdParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krIsik_id", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krIsik_id", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrIsikId(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrIsikIdResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrJIsikudVastus KrJIsikud(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrJIsikudParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krJIsikud", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krJIsikud", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrJIsikud(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrJIsikudResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrJIsikIdVastus KrJIsikId(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrJIsikIdParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krJIsik_id", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krJIsik_id", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrJIsikId(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrJIsikIdResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaIsikVastus KrUurijaIsik(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaIsikParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krUurijaIsik", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krUurijaIsik", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrUurijaIsik(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrUurijaIsikResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaIsikudVastus KrUurijaIsikud(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaIsikudParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krUurijaIsikud", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krUurijaIsikud", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrUurijaIsikud(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrUurijaIsikudResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaIsikIdVastus KrUurijaIsikId(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaIsikIdParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krUurijaIsik_id", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krUurijaIsik_id", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrUurijaIsikId(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrUurijaIsikIdResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaJIsikudVastus KrUurijaJIsikud(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaJIsikudParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krUurijaJIsikud", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krUurijaJIsikud", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrUurijaJIsikud(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrUurijaJIsikudResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaJIsikIdVastus KrUurijaJIsikId(global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrUurijaJIsikIdParing keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krUurijaJIsik_id", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krUurijaJIsik_id", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrUurijaJIsikId(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrUurijaJIsikIdResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrKodanikIsikVastus KrKodanikIsik(int keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krKodanikIsik", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krKodanikIsik", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrKodanikIsik(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrKodanikIsikResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.IKrKodanikIsikArhVastus KrKodanikIsikArh(int keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.karis.xtee.riik.ee/producer/karis", "krKodanikIsikArh", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("krKodanikIsikArh", "v2"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.KrKodanikIsikArh(keha)));
            return ((global::Producers.Karis.Xtee.Riik.Ee.Producer.Karis.Messages.IKrKodanikIsikArhResponse)(responseEnvelope.Body)).Keha;
        }
    }
}
